﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XChip_Common
{
   public  class NotesHelp
    {
        public static List<notes>  GetFileList(string path)
        {
            List<notes> list = new List<notes>();
            var str = File.ReadAllLines(path);
            using (StreamReader sr = new StreamReader(path))
            {
                string item;
                while ((item = sr.ReadLine())!=null)
                {
                    notes model = new notes();
                    var col = item.Replace('，', ',').Split(',');
                    if (col.Count() > 2)
                    {
                        model.addr = col[0];
                        model.value = col[1];
                        for (int i = 2; i < col.Count(); i++)
                        {
                            model.note += $"{col[i]} ";
                        }
                    }
                    else
                    {
                        model.note = item;
                    }
                    list.Add(model);
                }
            }
            return list;
        }

    }

    public class notes
    {
        public string note;
        public string addr;
        public string value;
        public string newAddr;
    }

}
